﻿<?php TPL::output('global/header.tpl.htm'); ?>
<div class="bd">
	<div class="tommy_rightDiv">
		<ul id="i_tabs" class="i_lsitecontents cl" style="border:none;">
			<li <?php if (!$_GET['category']) { ?> class="cur"<?php } ?>>
				<a href="topic/<?php echo $_GET['act']; ?>/">全部话题</a></li>
		    <?php if(is_array($this->content_category)) { ?>
		    <?php foreach ($this->content_category as $key => $val) { ?>			
				<li<?php if ($_GET['category'] AND ($val['id'] == $this->category_info['id'])) { ?> class="cur"<?php } ?>><a href="topic/<?php echo $_GET['act']; ?>/category-<?php echo $val['id'];?>" onclick="if ($('a[name=category_<?php echo $val['id'];?>]').val('name')) { $.scrollTo(($('a[name=category_<?php echo $val['id'];?>]').offset()['top'] - 10), 600, {queue:true}); return false; }"><?php echo $val['title']; ?></a></li>
			<?php } ?>
			<?php } ?>
		</ul>
  </div>

  <div class="contant_left readns_discus default_topic_piazza">
    <h2 class="c_title">
      <p id="default_topic_tab" class="sux"><a href="topic/hot/<?php if ($_GET['category']){ ?>category-<?php echo $_GET['category'];?><?php } ?>" <?php if ($_GET['act'] == 'hot' || $_GET['act'] == 'index') { ?> class="cur"<?php } ?>>热门</a> • <a href="topic/new/<?php if ($_GET['category']){ ?>category-<?php echo $_GET['category'];?><?php } ?>" <?php if ($_GET['act'] == 'new') { ?> class="cur"<?php } ?>>最新</a> • <a href="topic/category/" <?php if ($_GET['act'] == 'category') { ?> class="cur"<?php } ?>>分类</a></p>话题广场</h2>
      <div class="default_rx">
      	  <p class="gb_txt">话题是您的问题的关键词，使用正确的话题使其他人更容易看到您的问题，关注感兴趣的话题使我们更准确地为您推送内容。</p>
      	  
      	  <?php if ($_GET['act'] == 'category') { ?>
      	  <div id="itemize_tags" class="gb_class " style="padding-top:0;">
			<?php if(is_array($this->content_category)){ ?>
			<?php foreach($this->content_category AS $key => $val) { ?>
			<div class="gb_class">
				<a name="category_<?php echo $val['id'];?>"></a>
				<h3><img src="<?php echo $val['icon'];?>" class="gb_img" title="<?php echo $val['title'];?>" alt="<?php echo $val['title'];?>"/><?php echo $val['title'];?></h3>
				<div id="min_category_<?php echo $val['id'];?>">
					<div class="gb_top_list">
					<?php $i=0; ?>
					<?php foreach($val['topics'] AS $tkey => $tval){ ?>	  
					<?php $i++; if ($i > 80) { break; } ?>
						<a href="topic/<?php echo $tval['topic_title'];?>"><?php echo $tval['topic_title'];?></a>
					<?php } ?>
					</div>
					<p class="gb_more"><a href="javascript:void(0);" onclick="content_switcher($('#min_category_<?php echo $val['id'];?>'), $('#max_category_<?php echo $val['id'];?>')); return false;">显示全部 »</a></p>
					</div>
					
					<div id="max_category_<?php echo $val['id'];?>" class="hide">
				    <div class="gb_top_list ">
					<?php foreach($val['topics'] AS $tkey => $tval) {?>		  
	                	<a href="topic/<?php echo $tval['topic_title'];?>"><?php echo $tval['topic_title'];?></a>
					<?php } ?>
	                </div>				
				</div>
			</div>
			<?php } ?>
			<?php } ?>
		</div>
		<?php } else if (is_array($this->topics)) { ?>
		<div class="gb_class" id="hot_tags">
			<ul class="gb_lister">
			<?php foreach($this->topics AS $key => $val) {?>
				<li><p class="gb_top_list"><a href="topic/<?php echo $val['topic_title'];?>"><?php echo $val['topic_title'];?></a></p><?php echo cjk_substr($val['topic_description'],60);?><p class="gb_attention">问题数：<em><?php echo $val['question_count']*1;?></em> &nbsp;&nbsp;关注数：<em><?php echo $val['focus_count']*1;?></em></p>
                </li>
			<?php } ?>
            </ul>

			<div class="clear"></div>
			<?php echo $this->pagination; ?>
		</div>
		<?php } ?>
	</div>
  </div>
</div>
<script>
var i_tabs = $('#i_tabs a');
$(i_tabs).each(function(index, element) {
    $(this).click(function(){
		if(index == 0){
			$('#i_tabs').css('position','static');
		}else{
			$('#i_tabs').css('position','fixed');
		}	
	})
});
</script>
<?php TPL::output('global/footer.tpl.htm'); ?>
